import pyautogui


def mouse(action: str):
    action_dict = {
        '单击': pyautogui.click,
        '双击': pyautogui.doubleClick,
        '右键': pyautogui.rightClick,
        '上滚': lambda: pyautogui.scroll(200),
        '下滚': lambda: pyautogui.scroll(-200),
        '中键': lambda: pyautogui.mouseDown(button='middle')
    }
    if action in action_dict:
        action_dict[action]()
    else:
        print("未定义的动作")
